home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1989 Special Issue
/
rerun-1989-special-issue.d64
/
irq source#6
< prev
next >
Wrap
Text File
|
2022-09-20
|
2KB
|
57 lines
*= $C000
;
; THE SHAKING SCREEN
; ***** RASTER COMPARE DEMO *****
;
SEI ;Set Interrupt Disable Flag
LDA #<NEWIRQ ;Change IRQ RAM Vector
STA $0314
LDA #>NEWIRQ
STA $0315
CLI ;Clear Interrupt Disable Flag
LDA #$00 ;Intialize counters and VIC-II chip
STA $02 ;Set pointer to zero
STA $D012 ;Set Raster Compare for scan line 0
LDA #$1B
STA $D011 ;Set top bit to 0
LDA #$01
STA $D01A ;Enable Raster Compare Interrupt
STA $DC0D ;Disable Timer A interrupt from CIA 1
RTS
NEWIRQ
LDX $D012 ;Get value of current scan line
BNE NORMAL ;If not at scan line 0 normal display
SHIFT
LDY $02 ;Get pointer to fine scroll data
INY ;Increment pointer
CPY #$0E ;If at end of data ...
BNE GETY
LDY #$00 ;... then start again
GETY
LDA YS,Y ;Get fine scroll data
STA $D016 ;Put in horizontal fine scroll
;register
STY $02 ;Save pointer
LDA #$01
STA $D019 ;Reset Raster Compare Interrupt Latch
LDA #$9A ;Load value of next Raster
;Compare (154)
STA $D012 ;Save to Raster Compare Register
JMP $EA81 ;Exit interrupt routine through
;the KERNAL
NORMAL
LDA #$08 ;Set fine scroll to 0
STA $D016 ;Save to horizontal fine
;scroll register
LDA #$01
STA $D019 ;Reset Raster Compare Interrupt Latch
LDA #$00 ;Load value of next Raster Compare (0)
STA $D012 ;Save to Raster Compare Register
JMP $EA31 ;Jump to KERNAL IRQ routine
YS
.BYTE 8 9 10 11 12 13 14 15 ;Fine scroll data
.BYTE 14 13 12 11 10 9